package com.bocai.dahuatech.ui.adapter;

import android.content.Context;
import android.view.LayoutInflater;
import android.view.View;
import android.view.ViewGroup;
import android.widget.BaseAdapter;
import android.widget.TextView;

import com.bocai.dahuatech.Bean.ProductSeriesListBean_new;
import com.bocai.dahuatech.R;

import java.util.List;

public class ProductSecendAdapter extends BaseAdapter {
    private Context context;
    List<ProductSeriesListBean_new.ContentEntity> datas;
    public ProductSecendAdapter(Context context,List<ProductSeriesListBean_new.ContentEntity> datas){
        this.context=context;
        this.datas=datas;
    }
    @Override
    public int getCount() {
        return datas.size();
    }

    @Override
    public Object getItem(int position) {
        return datas.get(position);
    }

    @Override
    public long getItemId(int position) {
        return position;
    }

    @Override
    public View getView(int position, View convertView, ViewGroup parent) {
        ViewHolder holder;
        if(convertView==null)
        {
            holder=new ViewHolder();
            convertView= LayoutInflater.from(context).inflate(R.layout.product_secend_item,null);
            holder.tv_productsecend_name= (TextView) convertView.findViewById(R.id.tv_productsecend_name);
            convertView.setTag(holder);
        }else
        {
            holder= (ViewHolder) convertView.getTag();
        }
        holder.tv_productsecend_name.setText(datas.get(position).getFItemName());

        return convertView;
    }
    class ViewHolder{
        TextView tv_productsecend_name;

    }
}
